package com.feri.redromance01.controller;

import com.feri.redromance01.entity.VipInfo;
import com.feri.redromance01.service.intf.VipInfoService;
import com.feri.redromance01.vo.PageBean;
import com.feri.redromance01.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @autor wfl
 * @time 2022/8/29
 */
@RestController
@RequestMapping("/api/vipinfo/")
public class VipInfoController {
    @Autowired
    private VipInfoService service;
    //新增
    @PostMapping("add.do")
    public R add(VipInfo vipInfo) {
        return service.add(vipInfo);
    }
    //修改
    @PostMapping("update.do")
    public R update(VipInfo vipInfo){
      return service.update(vipInfo);
    }
    //删除
    @GetMapping("delete.do")
    public R delete(int id){
        return service.delete(id);
    }
    //查询
    @GetMapping("page.do")
    public PageBean page(String name,int page,int limit){
        return service.selectPage(name, page, limit);
    }
}
